From: Florian Müllner Date: Wed, 13 Jul 2011 19:22:35 +0000 (+0200) Subject: autorun-manager: Fix 'destroy' handler of resident source X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8055 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=86818e9c529d80cc610c1923468b9470258b5fad;p=gnome-shell.git autorun-manager: Fix 'destroy' handler of resident source If the resident source is destroyed, it should be recreated immediately, so that it is available when another volume is mounted. However, we only connect to the 'destroy' signal on the original source, not on newly created ones. As a result, the resident source only works twice, after that it shows up without icon and an empty notification. Fix by always connecting to the source's 'destroy' signal. --- diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js index 5ba4868da..2eb2bddaf 100644 --- a/js/ui/autorunManager.js +++ b/js/ui/autorunManager.js @@ -164,11 +164,7 @@ AutorunManager.prototype = { this._onMountRemoved)); this._transDispatcher = new AutorunTransientDispatcher(); - this._residentSource = new AutorunResidentSource(); - this._residentSource.connect('destroy', Lang.bind(this, - function() { - this._residentSource = new AutorunResidentSource(); - })); + this._createResidentSource(); let mounts = this._volumeMonitor.get_mounts(); @@ -182,6 +178,13 @@ AutorunManager.prototype = { })); }, + _createResidentSource: function() { + this._residentSource = new AutorunResidentSource(); + this._residentSource.connect('destroy', + Lang.bind(this, + this._createResidentSource)); + }, + _onMountAdded: function(monitor, mount) { // don't do anything if our session is not the currently // active one